<?php
namespace Teachers\Model;
use Think\Model\ViewModel;
class DocumentModel extends ViewModel {
   public $viewFields = array(
     'Document'=>array('*',),
     'DocumentArticle'=>array('id'=>'article_id', 'parse', 'content' , 'template', 'bookmark','_on'=>'DocumentArticle.id=Document.id'),
	 'School'=>array('school_name','_on'=>'School.school_id=Document.school_id'),
  	 'Category'=>array('title'=>'category','_on'=>'Category.id=(SELECT pid FROM onethink_category WHERE onethink_category.id=Document.category_id)'),
   );
 }
